<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="referrer" content="no-referrer" />
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        .image{
            display: table;
            width: 100vw;
            height: 100vh;
            text-align: center;
        }
        .img{
            display: table-cell;
            vertical-align: middle;
            line-height: 0;
        }

        img {
            width: 100vw;
            max-height:100vh;
            box-sizing: border-box;
            cursor: pointer;
        }
        img:hover{
            opacity: .6;
        }
    </style>
</head>

<body>
    <div class="image">
        <span class="img">
            <img src="img/load.gif" id="id_img" alt="">
        </span>
    </div>
</body>
<script>
    function getQueryVariable(variable) {
        var query = window.location.search.substring(1);
        var vars = query.split("&");
        for (var i = 0; i < vars.length; i++) {
            var pair = vars[i].split("=");
            if (pair[0] == variable) { return pair[1]; }
        }
        return (false);
    }
    function preLoadImg(url) {
        var img = new Image();
        img.src = url;
        img.onload = function () {
            document.getElementById('id_img').src = url;
        };
        img.onerror = function () {
            document.getElementById('id_img').src = "img/load.gif";
        }
    };

    var url = getQueryVariable('url');
    preLoadImg(url);
</script>

</html>